package com.ruoyi.factorydata.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.factorydata.domain.InventoryReceiptInfo;
import com.ruoyi.factorydata.domain.InventoryReceiptModelDetail;
import com.ruoyi.factorydata.domain.MaterialRequisitionDetail;
import com.ruoyi.factorydata.domain.ModelInventory;
import com.ruoyi.factorydata.domain.dto.ModelInventoryPrintDTO;

import java.math.BigDecimal;
import java.util.List;

/**
 * 母版库存Service接口
 *
 * @author ruoyi
 * @date 2025-07-27
 */
public interface IModelInventoryService extends IService<ModelInventory> {
    /**
     * 查询母版库存
     *
     * @param id 母版库存主键
     * @return 母版库存
     */
    public ModelInventory selectModelInventoryById(Long id);

    /**
     * 获取扫码信息
     * @param inventoryId 库存id
     */
    ModelInventory getScannerInfo(Long inventoryId);
    /**
     * 查询母版库存列表
     *
     * @param modelInventory 母版库存
     * @return 母版库存集合
     */
    public List<ModelInventory> selectModelInventoryList(ModelInventory modelInventory);

    /**
     * 母版库存打印
     *
     * @param modelInventory 母版库存
     * @return 母版库存打印
     */
    ModelInventoryPrintDTO printList(ModelInventory modelInventory);
    /**
     * 新增母版库存
     *
     * @param modelInventory 母版库存
     * @return 结果
     */
    public int insertModelInventory(ModelInventory modelInventory);

    /**
     * 修改母版库存
     *
     * @param modelInventory 母版库存
     * @return 结果
     */
    public int updateModelInventory(ModelInventory modelInventory);

    /**
     * 批量删除母版库存
     *
     * @param ids 需要删除的母版库存主键集合
     * @return 结果
     */
    public int deleteModelInventoryByIds(Long[] ids);

    /**
     * 删除母版库存信息
     *
     * @param id 母版库存主键
     * @return 结果
     */
    public int deleteModelInventoryById(Long id);

    /**
     * 母版入库单入库
     */
    void saveInventoryIn(InventoryReceiptInfo inventoryReceiptInfo, InventoryReceiptModelDetail inventoryReceiptModelDetail, String batchNumber);

    /**
     * 母版入库单入库
     */
    void updateInventoryIn(Long inventoryId,InventoryReceiptInfo inventoryReceiptInfo, InventoryReceiptModelDetail inventoryReceiptModelDetail);
    /**
     * 查询物存信息汇总
     *
     * @param modelInventory 库存信息
     * @return 物料库存汇总
     */
    Long countModelInventoryList(ModelInventory modelInventory);

    /**
     * 查询物料编码列表
     *
     * @param modelInventory 母版库存
     * @return 母版库存集合
     */
    List<ModelInventory> selectModelCodeList(ModelInventory modelInventory);

    /**
     * 领料单出库
     */
    void saveInventoryOut(MaterialRequisitionDetail materialRequisitionDetail, String inventoryBatchNumber, BigDecimal inventoryQuantity);
    /**
     * 领料单退料入库
     */
    void saveInventoryIn(MaterialRequisitionDetail materialRequisitionDetail, String inventoryBatchNumber, BigDecimal inventoryQuantity);

    /**
     * 母版出库
     */
    int outModelInventory(ModelInventory modelInventory);

    /**
     * 母版归还入库
     */
    int revertInModelInventory(ModelInventory modelInventory);
}